home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / BMP2BGI1.ZIP / BMP2BGI.TXT < prev    next >
Text File  |  1991-05-25  |  5KB  |  110 lines

  1. BMP2BGI: A utility to convert BMP graphic images to BGI format.
  2. Version: 1.0
  3. Date of Release: 6/25/91
  4. ===========================================================================
  5.  
  6.         This utility will convert 16-Color BMP images, like the ones drawn
  7. with MS Windows PAINT, to BGI format, so that the BGI image can be accessed
  8. through your Borland programs.  Any image of any size can be accommodated
  9. as long as its size does not exceed the size of your video card.  1024x768
  10. images will not be converted if your video card can only show 640x480.  
  11.  
  12.         The BMP images must be in uncompressed format, 16-color, and not
  13. created through OS/2.  These are the MS Windows 3.0 defaults.  A later
  14. version of BMP2BGI will support 256-color images.  
  15.  
  16.         The advantage of this is that now you can use a paint program
  17. better than one you could create yourself and convert the image to use
  18. in your Turbo Pascal, C, or C++ programs via the getimage() or putimage
  19. functions.  I found this to be helpful for writing games, creating neat-o 
  20. title screens, and so forth.  Granted, BGI is not the fastest nor most 
  21. convenient of graphics system, but it's free.  Not many of us hobbyists can 
  22. afford the SFX graphics library.  
  23.  
  24.         To convert your BMP file, create it & save it.  Then, on the DOS
  25. line, type:
  26.                 BMP2BGI FName.BMP
  27.                 
  28. where 'FName.BMP'is the BMP file.  Next, you will see some statistics about
  29. your file, and EITHER an error message that explains why the image couldn't
  30. be translated OR a message that informs you that conversion will commence.
  31. The conversion is nondestructive, i.e., your BMP file will be unchanged.
  32.  
  33. Then you will see the image on-screen, followed by black-masking as the
  34. image is converted.  The image is saved in the file 'FName.BGI', where 'FName'
  35. is the same 'FName' as your BMP file.  If FName.BGI already exists, it is
  36. written over.  Simple, yes?
  37.  
  38.         If you are interested in reverse-engineering BMP2BGI, I made it easy
  39. for you; I included all source code and project files.  NOTE: if you want to
  40. tinker around w/ BMP2BGI: the source code is in Turbo C++ (v1.0) and you will
  41. need to write your own fexist(char *) function that returns TRUE if a file
  42. exists or FALSE otherwise.  Of course, you could comment out the part of the
  43. source code that calls fexist(), as this won't affect the xlation.
  44.  
  45.         The BGI file is not exactly pure BGI, as there is a header before the 
  46. BGI bitmap images that contains various info.  Refer to BGI.H (included w/ 
  47. BMP2BGI) for an explanation.  IT IS IMPORTANT THAT YOUR BORLAND PROGRAMS USE 
  48. BGI.H TO ACCESS BGI IMAGES CREATED W/ BMP2BGI.  A sample program, SHOWBGI.EXE, 
  49. and accompanying source code is included to show you how.  
  50.  
  51.         I acknowledge Charles Petzold's informative article on
  52. BMP bitmaps as giving guidance if not outright variable names and BMP header
  53. structures.  If you are interested in the BMP file, refer to Mr.Petzold's
  54. article in PC Magazine (vol.10(10), pp365-370).
  55.  
  56. Included in this Zip-archive are the following files:
  57.  
  58. 0. This file:
  59.               BMP2BGI.Txt
  60.  
  61. 1. Turbo C++ source code for BMP2BGI:
  62.               bmp2bgi.c, bmp2bgi1.c, bmp2bgi2.c, bmp2bgi3.c      
  63.               bmp2bgi.prj  (The project file for BMP2BGI)
  64.               bgi.h, bmp.h (Header files for BMP and BGI image files)
  65.               
  66. 2. Turbo C++ source code for displaying BGI images created w/ BMP2BGI:
  67.               showbgi.c, showbgi2.c      
  68.               showbgi.prj  (The project file for SHOWBGI)
  69.  
  70. 3. Compiled Executables if you want to use the BMP2BGI right away:
  71.               bmp2bgi.exe, showbgi.exe     
  72.               
  73.  
  74. 4. And a sample BMP file:
  75.               test.bmp
  76.  
  77.  
  78.         
  79.         
  80. COPYRIGHTS (Because a lawyer suggested I do this):  
  81. ============================================================================
  82.  
  83. BMP.H: (c) Ziff-Davis Publishing
  84. BMP2BGI.EXE, SHOWBGI.EXE, BMP2BGI.c..BMP2BGI3.C, BGI.H, SHOWBGI.EXE, 
  85.         SHOWBGI.C, SHOWBGI2.C, TEST.BMP: (c) R.G.Rasulis Consulting Services
  86. MS Windows 3.0, MS Windows Paint, BMP: (c) Microsoft, Corp.
  87. Turbo C++, Turbo Pascal, Turbo C, BGI: (c) Borland International.
  88.       
  89. About the Author:
  90. ============================================================================
  91.  
  92. Richard Rasulis, Jr. is currently earning his doctoral degree in clinical
  93. psychology at the University of Montana.  Prior to becoming a "gradual"
  94. student, he worked as a hacker-4-hire in Boston, MA.  Amongst his hobbies is
  95. programming as well as conducting research on using computers to administer
  96. psychological tests.  He is the author of several PC programs, including
  97. scoring programs for various psychological tests.  Further, he is conducting
  98. research in the area of maturity and psychological well-being.  He may be
  99. contacted through the various addresses:
  100.  
  101.         SnailNet: R.G.Rasulis               EduNet: py__rgr@selway.umt.edu
  102.                   c/o Dep't of Psychology   GEnie: R.RASULIS
  103.                   University of Montana     
  104.                   Missoula, MT  59801      
  105.  
  106.                   
  107.  
  108.  
  109.         
  110.